// Grade32.cpp : Various utilities for easy to use Grade32 interface.
#include "gradeutils.h"

#include <cstdlib>

#define GUID_LEN		40

using namespace gKad;

TGradeAddr GradeUtils::String2GradeAddr(std::string *addr) {
	TGradeAddr	ret;
	wchar_t		s[GUID_LEN] = {0};
	size_t		guidLen = GUID_LEN;

	if (mbstowcs_s(&guidLen, s, guidLen, addr->c_str(), guidLen) != 0) {
		throw "Bad GUID format.";
	}

	CLSIDFromString(s , &ret);

	return ret;
}


